<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1 id="title1">11111</h1>
    <h1>22222</h1>
    <h1>33333</h1>

    <script>
        //获取DOM对象
        //1.通过id获取
        let h1 = document.querySelector('#title1')
        //2.selectorAll()
        let h1s = document.querySelectorAll('h1')
        console.log(h1s)

        //2.更改对象的属性或者方法
        h1.innerHTML = '我是h1'
        h1s[1].innerHTML = '我是h1s[1]'
        h1s[2].innerHTML = '我是h1s[2]'


    </script>
</body>
</html>